/*
 * Copyright 2017 JessYan
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.violet.repository.repository;

import com.violet.repository.repository.kotlin.data.CommDataSource;
import com.violet.repository.repository.kotlin.data.OrderDataSource;
import com.violet.repository.repository.kotlin.data.source.CommRepository;
import com.violet.repository.repository.kotlin.data.source.OrderRepository;

import javax.inject.Inject;

/**
 * ================================================
 * 用来管理网络请求层,以及数据缓存层,以后可能添加数据库请求层
 *
 * ================================================
 */
public class RepositoryManager implements IRepositoryManager {

    @Inject
    CommDataSource commDataSource;

    @Inject
    OrderDataSource orderDataSource;

    @Inject
    public RepositoryManager() {
    }

    /**
     * 手动创建，不通过dagger2
     * @param job
     */
    public RepositoryManager(boolean job) {
        commDataSource = new CommRepository();
        orderDataSource = new OrderRepository();
    }

    @Override
    public CommDataSource getCommRepository() {
        return commDataSource;
    }

    @Override
    public OrderDataSource getOrderRepository() {
        return orderDataSource;
    }

}
